package com.gouqi.mall.mapper;


import com.gouqi.mall.domain.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * 将mapper装配到spring容器中去，
 * 要在mapper接口中加上@Mapper注解，
 * 或者在启动类中加上@MapperScan（“包路径”）注解
 */
@Mapper
public interface UserMapper {
    // 新增一个用户
    Integer insertUser(User user);
    Integer getUserIdByAccount(String account);
    Boolean updateUserById(User user);
    User isHasUser(@Param(value = "account")String account, @Param(value="password") String password);

    User userIsExist(@Param(value = "phone")String phone, @Param(value="password")String password);

    Integer registerByPhoneAndGetId(User user);

    User queryUserDetails(@Param(value = "userId")String userId);
}
